package com.example.mapper;

import com.example.entity.singerAndGame.GSRelative;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface GAndSMapper {
    @Select("select * from game_singer_relative")
    List<GSRelative> getGSRelativeList();

    @Select("select * from game_singer_relative where gid = #{gid}")
    List<GSRelative> getGSRelativeByGid(int gid);

    @Insert("insert into game_singer_relative (gid, sid, judge_score) " +
            "VALUES (#{gid}, #{sid}, #{judge_score})")
    int addGSRelative(GSRelative gsRelative);

    @Update("update game_singer_relative set judge_score = #{judge_score} where sid = #{sid} and gid = #{gid}")
    int updateScoreBySidAndGid(GSRelative gsRelative);

    @Delete("delete from game_singer_relative where sid = #{sid} or gid = #{gid}")
    int deleteGSRelativeBySidOrGid(int id);
}
